package com.heima.controller;

import com.heima.model.admin.pojos.AdUser;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.service.AdUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenshan
 */
@RestController
@RequestMapping("login")
public class AdUserController {
    @Autowired
    private AdUserService userService;

    /**
     * 管理端用户登录接口
     * {"name":"guest","password":"guest"}
     */
    @PostMapping("in")
    public ResponseResult login(@RequestBody AdUser user) {
        return userService.login(user);
    }
}
